<template>
  <div class="cinemalist">
    <div
      class="cinemaitem"
      v-for="(cinema,index) in cinemas"
      :key="index"
      @click="goshows(cinema.id,$route.params.id)"
    >
      <div class="title">
        <span>{{cinema.nm}}</span>
        <span class="price-block">
          <span class="price">{{cinema.sellPrice}}</span>
          <span class="q">元起</span>
        </span>
      </div>
      <div class="location">
        <div class="flex">{{cinema.addr}}</div>
        <div class="distance">{{cinema.distance}}</div>
      </div>
      <div class="flex"></div>

      <div class="label-block" v-if="cinema.tag">
        <div class="allowRefund" v-if="cinema.tag.allowRefund===1">退</div>
        <div class="endorse" v-if="cinema.tag.endorse===1">改签</div>
        <div class="snack" v-if="cinema.tag.snack===1">小吃</div>
        <div class="vipTag">折扣卡</div>
      </div>
      <div class="label-block" v-else>
        <div class="allowRefund" v-if="cinema.allowRefund===1">退</div>
        <div class="endorse" v-if="cinema.endorse===1">改签</div>
        <div class="snack" v-if="cinema.snack===1">小吃</div>
        <div class="vipTag">折扣卡</div>
      </div>

      <div class="discount-block">
        <img
          src=""
          alt
        />

        <div class="discount-label-text">开卡特惠，首单2张最高立减6元</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['cinemas'],
  data: () => ({}),
  created () {},
  methods: {
    goshows (id, mid) {
      this.$router.push('/shows/' + id + '/' + mid)
      console.log(1)
    }
  }
}
</script>
<style lang="less" scoped>
.cinemalist {
  .cinemaitem {
    padding: 13px 15px 13px 0;
    margin-left: 15px;
    background-color: #fff;
    position: relative;
    overflow: hidden;
    .location {
      display: flex;
      margin-top: 6px;
      font-size: 13px;
      color: #666;
      .flex {
        flex: 1;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }
      .distance {
        margin-left: 5px;
      }
    }
    .title {
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
      display: flex;
      height: 23px;
      line-height: 23px;
      font-size: 16px;
      color: #000;
      .price-block {
        .price {
          font-size: 18px;
          color: #f03d37;
        }
        .q {
          font-size: 11px;
          color: #f03d37;
          margin-left: 3px;
        }
      }
    }
    .label-block {
      height: 17px;
      line-height: 17px;
      margin-top: 4px;
      margin-bottom: 4px;
      overflow: hidden;
      font-size: 0;
      flex-shrink: 0;
      display: flex;
      div {
        position: relative;
        display: inline-block;
        padding: 0 3px;
        height: 15px;
        margin-right: 5px;
        line-height: 15px;
        border-radius: 2px;
        font-size: 0.6rem;
      }
      .allowRefund {
        color: #589daf;
        border: 1px solid #589daf;
      }
      .endorse {
        color: #589daf;
        border: 1px solid #589daf;
      }
      .snack {
        color: #f90;
        border: 1px solid #f90;
      }
      .vipTag {
        color: #f90;
        border: 1px solid #f90;
      }
    }
    .discount-block {
      display: flex;
      line-height: 2;
      img {
        width: 15px;
        height: 14px;
        position: relative;
        top: 3px;
      }
      .discount-label-text {
        margin-left: 3px;
        font-size: 11px;
        color: #999;
      }
    }
  }
}
</style>
